package com.generic.dao.impl;

import java.util.List;

import org.hibernate.Query;

import com.generic.dao.ModuleDao;
import com.generic.ds.HibernateSession;
import com.generic.module.impl.Feed;

public class FeedDao extends ModuleDao {

	public FeedDao(HibernateSession session) {
		super(session, Feed.class);
	}
	
	@SuppressWarnings("unchecked")
	public List<Feed> getList(Long memberId) {
		StringBuffer sb = new StringBuffer("from Feed");
		sb.append(" where Foreign_Id = :foreignId");
		sb.append(" order by Created_Date desc");
		
		Query query = dsSession.createQuery(sb.toString());
		query.setLong("foreignId", memberId);
		
		return (List<Feed>)query.list();
	}
}
